const Sequelize = require('sequelize');
const config = require('../../config/config');

exports.sequelize = function () {
  const sequelize = new Sequelize('nexhome-home-page', 'root', config.mysql.pwd, {
    host: config.mysql.host,
    dialect: 'mysql',
    logging: true,
    timestamps: false,
    raw: true,
    dialectOptions: {
      charset: 'utf8mb4',
      collate: 'utf8mb4_unicode_ci',
    },
    pool: {
      max: 5,
      min: 0,
      acquire: 30000,
      idle: 10000,
    },
    timezone: '+08:00',
  });
  return sequelize;
};
